package com.guomao.filter;

import jakarta.servlet.*;
import jakarta.servlet.annotation.WebFilter;

import java.io.IOException;

@WebFilter("/*")
public class MyFilterB implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

        System.out.println("MyFilterB init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
                         FilterChain filterChain) throws IOException, ServletException {
        System.out.println("MyFilterB before");
//        System.out.println("MyFilterB doFilter");

        filterChain.doFilter(servletRequest, servletResponse);

        System.out.println("MyFilterB after");
    }

    @Override
    public void destroy() {
        System.out.println("MyFilterB destroy");
    }
}
